<%@ page contentType="text/html;charset=UTF-8" language="java" isELIgnored="false" %>
<html>
<head>
    <title>Title</title>
    <script src="jquery-3.3.1.min.js"></script>

</head>
<body>
<button onclick="f1();">发送并接收json数据</button>

</body>
<script>
    function f1() {
        $.ajax({
            url: "/json",
            type: 'post',

            data: '{"brand":"apple","model":"Hsdqw2132-232","price":399.9}',
            contentType: "application/json",

            dataType: "json",
            success: function (data) {
                console.log(data.brand);
            }
        });
    }
</script>
</html>